package com.factory._13observe.demo3;

import java.util.concurrent.Flow;

/**
 * @author Qinye
 * @date 2023/8/13 16:42
 */
public class MObserver implements Flow.Subscriber<String> {
    @Override
    public void onSubscribe(Flow.Subscription subscription) {
        System.out.println("MObserver.onSubscribe");
        subscription.cancel();
    }

    @Override
    public void onNext(String item) {
        System.out.println("MObserver.onNext"+ item);
    }

    @Override
    public void onError(Throwable throwable) {
        System.out.println("MObserver.onError");
    }

    @Override
    public void onComplete() {
        System.out.println("MObserver.onComplete");
    }
}
